<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<style>
  .main {
    display: flex;
    width: 500px;
    height: 500px;
    background-color: aqua;
    flex-wrap: wrap;
    /* 这个属性只对单行的元素生效，多行的话请使用align-content控制 */
    /* align-items: center; */
    /* 控制多行元素的排列方式，必须设置flex-wrap:wrap;开启多行排列才生效 */
    align-content: space-evenly;
  }
  .main div {
    width: 200px;
    height: 100px;
    background-color: red;
    border: 1px solid black;
  }
</style>
<body>
  <div class="main">
    <div>1</div>
    <div>1</div>
    <div>1</div>
    <div>1</div>
    <div>1</div>
    <div>1</div>
  </div>
</body>
</html>